package pathFinderPackage.Ants;

import java.util.HashMap;
import java.util.List;

import mapPackage.MapException;
import pathFinderPackage.IChercheurItineraire;
import pathFinderPackage.Itineraire;
import pathFinderPackage.BiDijkstra.BiDirectionnalDijkstra;
import pathFinderPackage.BiDijkstra.ThreadBiDijkstra;
import preferencePackage.Preference;

public class AntsAlgo extends IChercheurItineraire{
	private static ThreadAnts threadAnt = null ;
	
	
	public AntsAlgo(){
		super();
	}
		
	public void trouverItineraire(String villeDepart, String villeArrivee, List<Preference> preferences ,  HashMap<String,Boolean> villesIntermediaires) throws MapException {
		
		if (threadAnt != null)
			try {
				threadAnt.join();
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		threadAnt = new ThreadAnts(villeDepart,villeArrivee,preferences,villesIntermediaires,this);
		threadAnt.start();
		try {
			threadAnt.join();
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
	

	

}
